home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / misc / emu / ATUtilities.lha / ATUtilities / BASIC / TIMESERV.BAS < prev    next >
BASIC Source File  |  2000-09-26  |  5KB  |  136 lines

  1. rem ==============================================================
  2. rem == Interrupt $0B:                                           ==
  3. rem ==   AH=Funktionsnummer                                     ==
  4. rem ==                                                          ==
  5. rem == AH=1:  GetParamOffset                                    ==
  6. rem ==          => AL = JIntNummer                              ==
  7. rem ==          <= DI = Offset                                  ==
  8. rem ==                                                          ==
  9. rem == AH=2:  AllocJanusMem                                     ==
  10. rem ==          => AL = Speichertyp                             ==
  11. rem ==          => BX = Anzahl der Bytes                        ==
  12. rem ==          <= BX = Offset auf Speicher                     ==
  13. rem ==                                                          ==
  14. rem == AH=3:  FreeJanusMem                                      ==
  15. rem ==          => AL = Speichertyp                             ==
  16. rem ==          => BX = Offset auf Speicher                     ==
  17. rem ==                                                          ==
  18. rem == AH=4:  SetParamOffset                                    ==
  19. rem ==            => AL = JIntNummer                          ==
  20. rem ==          => BX = Offset                                  ==
  21. rem ==                                                          ==
  22. rem == AH=5:  Nicht benutzt                                     ==
  23. rem == AH=6:  Nicht benutzt                                     ==
  24. rem ==                                                          ==
  25. rem == AH=11: GetService                                        ==
  26. rem ==          => AL = Flags                                   ==
  27. rem ==          => CX = LocalID                                 ==
  28. rem ==          => DI = Offset von PCCustomer                   ==
  29. rem ==          => SI = AppID (2. Wort)                         ==
  30. rem ==          => DS = AppID (1. Wort)                         ==
  31. rem ==          => ES = Segment von FirstPCCustomer             ==
  32. rem ==          <= DI = Offset auf ServiceData-Struktur         ==
  33. rem ==                                                          ==
  34. rem == AH=12: CallService                                       ==
  35. rem ==            => DI = Service                         ==
  36. rem ==                                                          ==
  37. rem == AH=13: ReleaseService                                    ==
  38. rem ==          => DI = Service                                 ==
  39. rem ==                                                          ==
  40. rem == AH=15: LockService                                       ==
  41. rem ==          => DI = Service                                 ==
  42. rem ==                                                          ==
  43. rem == AH=16: UnLockService                                     ==
  44. rem ==          => DI = Service                                 ==
  45. rem ==                                                          ==
  46. rem ==============================================================
  47.  
  48. $INCLUDE "REGNAMES.INC"
  49. def seg = &hd000
  50. cls
  51.  
  52. REG %AX,(2*256)+1   : rem AllocJanusMem
  53. REG %BX,24          : rem Bytes
  54. CALL INTERRUPT &H0B : rem AllocJanusMem(8,1)
  55. mem=REG(%BX)
  56. if mem<1 then
  57.  ?"Nicht genug Janus-Speicher"
  58.  goto ende
  59. end if:rem
  60.  
  61. rAH=11              : rem GetService
  62. rAL=&H10            : rem Flags
  63. rCX=1               : rem LocalID
  64. rDI=mem             : rem Offset auf PC-Server
  65. rSI=1               : rem ApplicationID (Low)
  66. rDS=0               : rem ApplicationID (High)
  67. rES=&HD000          : rem Segment von PC-Server
  68.  
  69. poke  mem+00,&HB8   : rem MOV AX,0D000
  70. pokei mem+01,&HD000 : rem MOV ES,AX
  71. poke  mem+03,&H8E   : rem ES MOV B[mem+20],127
  72. poke  mem+04,&HC0   : rem RETF
  73. poke  mem+05,&H26
  74. poke  mem+06,&HC6
  75. poke  mem+07,&H06
  76. pokei mem+08,mem+12
  77. poke  mem+10,&H7F
  78. poke  mem+11,&HCB
  79.  
  80. poke  mem+12,255
  81.  
  82. REG %AX,(rAH*256)+rAL
  83. REG %CX,rCX
  84. REG %DI,rDI
  85. REG %SI,rSI
  86. REG %DS,rDS
  87. REG %ES,rES
  88. call interrupt &HB
  89.  
  90. rAX=REG(%AX)
  91. x=varptr(rAX)
  92. l=peek(x+0)
  93. c=peek(x+1)
  94. serv=reg(%DI)
  95. if l=0 and c=0 and serv>0 then
  96.  
  97.  REG %DI,serv           : rem Service
  98.  REG %AX,(12*256)       : rem CallService
  99.  CALL INTERRUPT &H0B    : rem CallService()
  100.  while (peek(mem+12)<>127) : wend
  101.  
  102.  ?"Service:       ";serv
  103.  ?"AmigaUserCount:";peek(serv+9)
  104.  ?"PCUserCount:   ";peek(serv+10)
  105.  ?"---------------------------------"
  106.  segm=peeki(serv+24)
  107.  ofs=peeki(serv+22)
  108.  def seg = segm
  109.  ?"Jahr:   ";peeki(ofs+0)
  110.  ?"Monat:  ";peek(ofs+2)
  111.  ?"Tag:    ";peek(ofs+3)
  112.  ?"Stunde: ";peek(ofs+4)
  113.  ?"Minute: ";peek(ofs+5)
  114.  ?"Sekunde:";peek(ofs+6)
  115.  ?"String:  ";
  116.  for i=7 to 7+24
  117.   ?chr$(peek(ofs+i));
  118.  next
  119.  ?"Error:  ";peeki(ofs+34)
  120.  ?"---------------------------------"
  121.  
  122.  REG %DI,serv           : rem Service
  123.  REG %AX,(13*256)       : rem ReleaseService
  124.  CALL INTERRUPT &H0B    : rem ReleaseService()
  125.  
  126.  REG %BX,mem            : rem Speicher
  127.  REG %AX,(3*256)+1      : rem FreeJanusMem
  128.  CALL INTERRUPT &H0B    : rem FreeJanusMem(mem,1)
  129.  
  130. else
  131.  ?"TimeServ ist nicht aktiv."
  132. end if
  133.  
  134. ende:
  135. end
  136.